-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kafka fix #1212
Kafka fix #1212
Conversation
Update Listener.ts
…IGIT-Frontend into campaign-for-test
Ashish patch 1
This reverts commit e86a4dc.
Update Producer.ts
Update Producer.ts
…IGIT-Frontend into campaign-for-test
adding constraint
Update V20240731162600__add_uniqiue_constraint_process_track.sql
Update constants.ts
Improved kafka
WalkthroughWalkthroughThe recent changes involve a significant restructuring of the Kafka messaging components within the application. The function Changes
Sequence Diagram(s)sequenceDiagram
participant Utils as Utility Functions
participant Producer as Kafka Producer
participant Listener as Kafka Listener
Utils->>Producer: call produceModifiedMessages()
Producer->>Producer: createProducer()
Producer->>Producer: sendWithRetries()
Producer->>Utils: log success/error
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- utilities/project-factory/src/server/api/campaignApis.ts (1 hunks)
- utilities/project-factory/src/server/kafka/Listener.ts (2 hunks)
- utilities/project-factory/src/server/kafka/Producer.ts (2 hunks)
- utilities/project-factory/src/server/utils/campaignMappingUtils.ts (1 hunks)
- utilities/project-factory/src/server/utils/campaignUtils.ts (1 hunks)
- utilities/project-factory/src/server/utils/genericUtils.ts (1 hunks)
- utilities/project-factory/src/server/utils/processTrackUtils.ts (1 hunks)
Additional comments not posted (11)
utilities/project-factory/src/server/kafka/Listener.ts (1)
4-4
: LGTM! But verify the impact of the removed import statement.The removal of the
throwError
import statement is approved.However, ensure that there are no references to
throwError
in this file.Verification successful
No issues found with the removed import statement.
The
throwError
import statement was removed, and there are no references tothrowError
inutilities/project-factory/src/server/kafka/Listener.ts
.
- The removal does not impact the file.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that there are no references to `throwError` in this file. # Test: Search for references to `throwError`. Expect: No occurrences. rg --type ts 'throwError' utilities/project-factory/src/server/kafka/Listener.tsLength of output: 80
utilities/project-factory/src/server/kafka/Producer.ts (4)
21-33
: LGTM! Ensure proper initialization of the producer.The
createProducer
function is correctly implemented and the event listeners are properly set up.
60-89
: LGTM! Ensure proper handling of retries and errors.The
sendWithRetries
function is correctly implemented and the retry logic is properly handled.
92-108
: LGTM! But verify the impact of the relocated function.The
produceModifiedMessages
function is correctly integrated and the call tosendWithRetries
is properly handled.However, ensure that all references to
produceModifiedMessages
are updated to the new location.Verification successful
All references to
produceModifiedMessages
are correctly updated to the new location.The function
produceModifiedMessages
is correctly integrated, and all references point to the new location inProducer.ts
.
utilities/project-factory/src/server/utils/campaignUtils.ts
utilities/project-factory/src/server/utils/genericUtils.ts
utilities/project-factory/src/server/utils/processTrackUtils.ts
utilities/project-factory/src/server/utils/campaignMappingUtils.ts
utilities/project-factory/src/server/api/campaignApis.ts
utilities/project-factory/src/server/kafka/Producer.ts
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that all references to `produceModifiedMessages` are updated to the new location. # Test: Search for references to `produceModifiedMessages`. Expect: Only occurrences of the new location. rg --type ts 'produceModifiedMessages'Length of output: 3568
110-110
: LGTM! But verify the impact of the updated export statement.The export statement is correctly updated to export
produceModifiedMessages
instead ofproducer
.However, ensure that there are no references to the
producer
export in the codebase.Verification successful
The export statement update is correctly implemented.
- No references to
producer
were found, confirming it is safe to remove its export.- Multiple references to
produceModifiedMessages
confirm it is correctly used in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that there are no references to the `producer` export in the codebase. # Test: Search for references to the `producer` export. Expect: No occurrences. rg --type ts 'producer' --glob '!Producer.ts'Length of output: 45
Script:
#!/bin/bash # Description: Verify that there are no references to the `producer` export and that `produceModifiedMessages` is correctly referenced in the codebase. # Test 1: Search for references to the `producer` export. Expect: No occurrences. rg --type ts '\bproducer\b' --glob '!Producer.ts' # Test 2: Search for references to `produceModifiedMessages` to ensure it is being used correctly. rg --type ts 'produceModifiedMessages'Length of output: 3620
utilities/project-factory/src/server/utils/processTrackUtils.ts (1)
2-2
: LGTM! But verify the impact of the updated import statement.The import statement is correctly updated to reference
produceModifiedMessages
fromProducer.ts
instead ofListener.ts
.However, ensure that the new reference does not introduce any issues.
Verification successful
LGTM! But verify the impact of the updated import statement.
The import statement is correctly updated to reference
produceModifiedMessages
fromProducer.ts
instead ofListener.ts
.
- The function
produceModifiedMessages
is correctly defined inProducer.ts
.- The function is correctly exported from
Producer.ts
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the new reference to `produceModifiedMessages` does not introduce any issues. # Test: Search for references to `produceModifiedMessages` in this file. Expect: No issues with the new reference. rg --type ts 'produceModifiedMessages' utilities/project-factory/src/server/utils/processTrackUtils.tsLength of output: 388
Script:
#!/bin/bash # Description: Verify that `produceModifiedMessages` is correctly defined and exported in `Producer.ts`. # Locate the definition of `produceModifiedMessages` in `Producer.ts` ast-grep --lang typescript --pattern 'function produceModifiedMessages($_, $_) { $$$ }' # Locate the export statement for `produceModifiedMessages` in `Producer.ts` rg 'export { produceModifiedMessages }' --type tsLength of output: 1960
Script:
#!/bin/bash # Description: Verify that `produceModifiedMessages` is correctly exported in `Producer.ts`. # Locate the export statement for `produceModifiedMessages` in `Producer.ts` rg 'export .*produceModifiedMessages' --type tsLength of output: 140
utilities/project-factory/src/server/utils/campaignMappingUtils.ts (1)
6-6
: Ensure the new import path is correct.The import statement for
produceModifiedMessages
has been updated. Verify that the new path../kafka/Producer
is correct and that theproduceModifiedMessages
function is exported from this module.Verification successful
The import path is correct.
- The
produceModifiedMessages
function is defined inutilities/project-factory/src/server/kafka/Producer.ts
.- It is correctly exported from this module.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the export of `produceModifiedMessages` from `../kafka/Producer`. # Test: Search for the export of `produceModifiedMessages` in the Producer module. Expect: The function should be exported. rg --type ts -A 5 $'export function produceModifiedMessages'Length of output: 61
Script:
#!/bin/bash # Description: Locate the definition of `produceModifiedMessages` in the entire codebase. # Test: Search for the definition of `produceModifiedMessages`. Expect: The function should be defined somewhere in the codebase. rg --type ts 'function produceModifiedMessages'Length of output: 182
Script:
#!/bin/bash # Description: Verify the export of `produceModifiedMessages` from `Producer.ts`. # Test: Search for the export statement of `produceModifiedMessages` in `Producer.ts`. Expect: The function should be exported. rg --type ts 'export.*produceModifiedMessages' utilities/project-factory/src/server/kafka/Producer.tsLength of output: 139
utilities/project-factory/src/server/api/campaignApis.ts (1)
11-11
: Ensure the new import path is correct.The import statement for
produceModifiedMessages
has been updated. Verify that the new path../kafka/Producer
is correct and that theproduceModifiedMessages
function is exported from this module.Verification successful
The import path is correct.
The
produceModifiedMessages
function is correctly exported fromutilities/project-factory/src/server/kafka/Producer.ts
, and the import path used incampaignApis.ts
is accurate.
utilities/project-factory/src/server/kafka/Producer.ts
: The function is defined and exported here.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the export of `produceModifiedMessages` from `../kafka/Producer`. # Test: Search for the export of `produceModifiedMessages` in the Producer module. Expect: The function should be exported. rg --type ts -A 5 $'export function produceModifiedMessages'Length of output: 61
Script:
#!/bin/bash # Description: Verify the existence of `Producer` module and the export of `produceModifiedMessages` function. # Locate the Producer module echo "Searching for Producer module..." fd 'Producer.ts' # Verify the export of produceModifiedMessages function echo "Verifying the export of produceModifiedMessages function..." rg 'produceModifiedMessages' -A 5Length of output: 17833
utilities/project-factory/src/server/utils/genericUtils.ts (1)
5-5
: Ensure the new import path is correct.The import statement for
produceModifiedMessages
has been updated. Verify that the new path../kafka/Producer
is correct and that theproduceModifiedMessages
function is exported from this module.Verification successful
The import path is correct.
The
produceModifiedMessages
function is correctly exported from theutilities/project-factory/src/server/kafka/Producer.ts
module.
utilities/project-factory/src/server/kafka/Producer.ts
:export { produceModifiedMessages };
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the export of `produceModifiedMessages` from `../kafka/Producer`. # Test: Search for the export of `produceModifiedMessages` in the Producer module. Expect: The function should be exported. rg --type ts -A 5 $'export function produceModifiedMessages'Length of output: 61
Script:
#!/bin/bash # Description: Verify the export of `produceModifiedMessages` from the `Producer` module. # Search for named exports of `produceModifiedMessages` rg --type ts -A 5 'export function produceModifiedMessages' # Search for named exports in an export block rg --type ts -A 5 'export { produceModifiedMessages }' # Search for default exports that might include the function rg --type ts -A 5 'export default { produceModifiedMessages }'Length of output: 451
Script:
#!/bin/bash # Description: Verify the export of `produceModifiedMessages` from the `Producer` module. # Search for named exports of `produceModifiedMessages` rg --type ts -A 5 'export function produceModifiedMessages' # Search for named exports in an export block rg --type ts -A 5 'export \{ produceModifiedMessages \}' # Search for default exports that might include the function rg --type ts -A 5 'export default \{ produceModifiedMessages \}' # Search for any export statements that might include produceModifiedMessages rg --type ts -A 5 'export .*produceModifiedMessages'Length of output: 424
utilities/project-factory/src/server/utils/campaignUtils.ts (2)
5-5
: Verify the correctness of the import change.The import statement for
produceModifiedMessages
has been updated from../kafka/Listener
to../kafka/Producer
. Ensure that the new module provides the same functionality and that all references toproduceModifiedMessages
are correct.Verification successful
Verified: The import statement for
produceModifiedMessages
is correct and consistent.The
produceModifiedMessages
function is defined inutilities/project-factory/src/server/kafka/Producer.ts
and is correctly exported. The import statement inutilities/project-factory/src/server/utils/campaignUtils.ts
is accurate.
utilities/project-factory/src/server/kafka/Producer.ts
: Function definition and export.utilities/project-factory/src/server/utils/campaignUtils.ts
: Correct import and usage.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `produceModifiedMessages` function is correctly imported from the new module. # Test: Search for the function definition in the new module. rg --type ts -A 5 $'export function produceModifiedMessages' ../kafka/ProducerLength of output: 137
Script:
#!/bin/bash # Description: Search for the `produceModifiedMessages` function definition across the entire codebase. # Test: Search for the function definition in the entire codebase. rg --type ts -A 5 $'export function produceModifiedMessages'Length of output: 61
Script:
#!/bin/bash # Description: Search for the `produceModifiedMessages` function name across the entire codebase. # Test: Search for the function name in the entire codebase. rg 'produceModifiedMessages'Length of output: 3558
Line range hint
818-821
: Verify the usage ofproduceModifiedMessages
.Ensure that the usage of
produceModifiedMessages
in thegenerateProcessedFileAndPersist
function is correct and consistent with its definition in the new module.Verification successful
The usage of
produceModifiedMessages
in thegenerateProcessedFileAndPersist
function is correct and consistent with its definition in the new module.
- The function
produceModifiedMessages
is defined to take two parameters:modifiedMessages
andtopic
.- In
campaignUtils.ts
, it is consistently called with two arguments, which align with its definition.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `produceModifiedMessages` in the `generateProcessedFileAndPersist` function. # Test: Search for the function usage. Expect: Consistent usage with the new module definition. rg --type ts -A 5 $'produceModifiedMessages' utilities/project-factory/src/server/utils/campaignUtils.tsLength of output: 3117
Script:
#!/bin/bash # Description: Locate and review the definition of `produceModifiedMessages` in the `../kafka/Producer` module. # Search for the definition of `produceModifiedMessages` in the `../kafka/Producer` module. ast-grep --lang typescript --pattern 'function produceModifiedMessages($_, $_) { $$$ }'Length of output: 1782
* Update Listener.ts * added new branch * Update Listener.ts * fixed mapping kafka error * mapping kafka fixed * fix kafka * fix kafka * Removing foreign key constraint * Producer update * Revert "Ashish egov patch 2 (#1178)" This reverts commit e86a4dc. * Update Producer.ts * Update Producer.ts * Feat : updated producemodified message * Feat : removed waiting * adding constraint * Update V20240731162600__add_uniqiue_constraint_process_track.sql * Update constants.ts * Feat : improved kafka * Fix kafka restart issue
No description provided.